"use strict"

/**
 * 陕西省政府采购网爬虫
 *  
 */

var Base = require("./base");
var sx_spider = new Base();
sx_spider.name = "陕西省采购网";
sx_spider.page = 1;
sx_spider.encode = "GBK";

sx_spider.getPageUrl = function (pg) {
    return "http://www.ccgp-shaanxi.gov.cn/cggg.jsp";
};

sx_spider.getItems = function ($) {
    var items = [];
    $(".center_center_x a").each(function (index, ele) {
        var e = $(ele);
        var item = {};
        item.title = e.text();
        var url = e.attr("href");
        item.url = "http://www.ccgp-shaanxi.gov.cn/" + url;
        item.source = sx_spider.name;
        items.push(item);
    });
    return items;
};

exports = module.exports = sx_spider;